package oop_06.homework04;

public class BloodWarrior extends Warrior {
    public BloodWarrior(int experience, int blood) {
        super(experience, blood);
    }
    public void injure(int x) {

        System.out.println("战士受伤了，减少"+x+"血量");
        this.setBlood(this.getBlood()-x);
        if(this.getBlood()<(MAX/2))
        {
            System.out.println("血量过低，危险***###");
        }
        if(this.getBlood()<0)
        {
            System.out.println("战士死了~~~~");
            System.exit(1);
        }
        if (this.getBlood()>0){
            System.out.println("win!!!!!!");
             this.setExperience(getExperience()+10);
        }
    }


}
